// 引入请求数据的函数，分别暴露一定要记得加{}
import { reqStockInfo } from '@/api/index'
// 创建action,mutation,state,getter对象
const state = {
  stockInfo: {}
}
const actions = {
  // 获取UserName
  async getStockInfo({ commit } ,params) {
    const result = await reqStockInfo(params)
    if (result.Code === '1') { // 如果请求成功，result.code就是200
      commit('GETSTOCKInfo', result.Content)
    }
  }
}
const mutations = {

    GETSTOCKInfo(state, stockInfo) {
        state.stockInfo = stockInfo // 将数据交给state
    }
}
const getters = {

}

export default {
  actions,
  mutations,
  state,
  getters
}
